import { axiosInstance } from '../utils/http'

export const postLoginApi = (data: any) => {
  return axiosInstance.post('/user/login', data)
}

export const postRegisterAccountApi = (data: any) => {
  return axiosInstance.post('/user/register', data)
}

export const getRegisterCaptchaApi = (address: string) => {
  return axiosInstance.get(`/user/register-captcha`, {
    params: {
      address,
    },
  })
}

export const getEditPosswordCaptchApi = (address: string) => {
  return axiosInstance.get(`/user/update_password/captcha`, {
    params: {
      address,
    },
  })
}

export const postUpdatePasswordApi = (data: any) => {
    return axiosInstance.post(`/user/update_password`, data)
}

export const getUserInfoApi = () => {
  return axiosInstance.get('/user/info')
}

export const updateUserInfoCaptcha = (email: string) => {
  return axiosInstance.get(`/user/update/captcha?address=${email}`)
}

export const updateInfo = (data: any) => {
  return axiosInstance.post(`/user/update`, data)
}